# config.py

# 用户名和密码，根据您的需要修改这些值
USER_NAME = "19303065924"
PASSWORD = "asd1234567"
SALE_PASSWORD = "961015"

# 登录页面的URL，根据您的需求修改
LOGIN_URL = "https://www.mtesifyme.com/h5/#/pages/login/login"

# 可以根据需要添加其他配置


class Selectors:
    # 登录相关的选择器
    PHONE_INPUT_XPATH = "//div[contains(text(), '请输入手机号')]/following-sibling::input"
    PASSWORD_INPUT_XPATH = "//div[contains(text(), '请输入密码')]/following-sibling::input"
    AGREE_IMAGE_XPATH = "//uni-view[2]/uni-view[6]/uni-image/img"
    LOGIN_BUTTON_XPATH = (
        "//uni-view[contains(@class, 'login_btn') and contains(text(), '登 录')]"
    )
    # 交易
    MARKET_BUTTON_XPATH = "//uni-view[8]/uni-view/uni-view[1]/uni-view[1]/uni-view[3]/uni-view/uni-image/img"

    # 功能按钮相关的选择器
    POST_BUTTON_XPATH = "//uni-view[contains(text(), '我要发布')]"
    MY_POSTS_BUTTON_XPATH = "//uni-view[contains(text(), '我的发布')]"
    MY_ORDERS_BUTTON_XPATH = "//uni-view[contains(text(), '我的订单')]"
    MY_PURCHASES_BUTTON_XPATH = "//uni-view[contains(text(), '我的买入')]"
    MY_SALES_BUTTON_XPATH = "//uni-view[contains(text(), '我的出售')]"

    NO_DATA_IMAGE_XPATH = "//img[@src='/h5/static/img/nodata.8669c124.png']"

    CHOOSE_NUMBER_XPATH = (
        "//uni-view[contains(@class, 'sr_input cfff2') and contains(text(), '请选择数量')]"
    )
    NUMBER_100_XPATH = "//uni-picker-view/div/uni-picker-view-column/div/div[3]/uni-text[6]"
    NUMBER_50_XPATH = "//uni-picker-view/div/uni-picker-view-column/div/div[3]/uni-text[5]"
    NUMBER_25_XPATH = "//uni-picker-view/div/uni-picker-view-column/div/div[3]/uni-text[5]"
    NUMBER_10_XPATH = (
        "//uni-picker-view/div/uni-picker-view-column/div/div[3]/uni-text[3]"
    )
    NUMBER_5_XPATH = (
        "//uni-picker-view/div/uni-picker-view-column/div/div[3]/uni-text[2]"
    )
    NUMBER_OK_XPATH = "//uni-view/uni-view[5]/uni-view[2]/uni-view/uni-view[1]/uni-view/uni-view[2]/uni-text"
    SALE_PASSWORD_INPUT_XPATH = (
        "//div[contains(text(), '请输入交易密码')]/following-sibling::input"
    )
    SALE_OK_XPATH = "//uni-view[contains(@class, 'fb_btn') and contains(text(), '发布')]"

    FINAL_OK_XPATH = "//uni-view[contains(@class, 'qd_btn') and contains(text(), '确定')]"

    # 撤销发布
    Revoke_Publication = (
        "//uni-view[contains(@class, 'cs_btn') and contains(text(), '撤销')]"
    )
    BACK_BTN_OK_XPAHT = "//uni-view/uni-view[1]/uni-view[2]/uni-view[2]/uni-view/uni-view/uni-text/span"
# /html/body/uni-app/uni-page/uni-page-wrapper/uni-page-body/uni-view/uni-view[2]/uni-view[1]/uni-view[1]/uni-view[2]/uni-view[2]
# /html/body/uni-app/uni-page/uni-page-wrapper/uni-page-body/uni-view/uni-view[2]/uni-view[2]/uni-view[1]/uni-view[2]/uni-view[2]